package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppDynamicTimelineMapper;
import com.ruoyi.system.domain.AppDynamicTimeline;
import com.ruoyi.system.service.IAppDynamicTimelineService;

/**
 * 时间轴Service业务层处理
 *
 * @author ruoyi
 * @date 2023-02-28
 */
@Service
public class AppDynamicTimelineServiceImpl extends ServiceImpl<AppDynamicTimelineMapper, AppDynamicTimeline> implements IAppDynamicTimelineService {
    @Autowired
    private AppDynamicTimelineMapper appDynamicTimelineMapper;

    /**
     * 查询时间轴
     *
     * @param id 时间轴主键
     * @return 时间轴
     */
    @Override
    public AppDynamicTimeline selectAppDynamicTimelineById(Long id) {
        return appDynamicTimelineMapper.selectAppDynamicTimelineById(id);
    }

    /**
     * 查询时间轴列表
     *
     * @param appDynamicTimeline 时间轴
     * @return 时间轴
     */
    @Override
    public List<AppDynamicTimeline> selectAppDynamicTimelineList(AppDynamicTimeline appDynamicTimeline) {
        return appDynamicTimelineMapper.selectAppDynamicTimelineList(appDynamicTimeline);
    }

    /**
     * 新增时间轴
     *
     * @param appDynamicTimeline 时间轴
     * @return 结果
     */
    @Override
    public int insertAppDynamicTimeline(AppDynamicTimeline appDynamicTimeline) {
        return appDynamicTimelineMapper.insertAppDynamicTimeline(appDynamicTimeline);
    }

    /**
     * 修改时间轴
     *
     * @param appDynamicTimeline 时间轴
     * @return 结果
     */
    @Override
    public int updateAppDynamicTimeline(AppDynamicTimeline appDynamicTimeline) {
        return appDynamicTimelineMapper.updateAppDynamicTimeline(appDynamicTimeline);
    }

    /**
     * 批量删除时间轴
     *
     * @param ids 需要删除的时间轴主键
     * @return 结果
     */
    @Override
    public int deleteAppDynamicTimelineByIds(Long[] ids) {
        return appDynamicTimelineMapper.deleteAppDynamicTimelineByIds(ids);
    }

    /**
     * 删除时间轴信息
     *
     * @param id 时间轴主键
     * @return 结果
     */
    @Override
    public int deleteAppDynamicTimelineById(Long id) {
        return appDynamicTimelineMapper.deleteAppDynamicTimelineById(id);
    }

    @Override
    public int countByUserIdAndIsRead(AppDynamicTimeline appDynamicTimeline) {
        List<AppDynamicTimeline> list = appDynamicTimelineMapper.selectAppDynamicTimelineList(appDynamicTimeline);
        return list.size();
    }
}
